package com.tm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tm.dto.StaffQueryDTO;
import com.tm.entity.StaffEntity;
import com.tm.mapper.StaffMapper;
import com.tm.service.StaffService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @PROJECT_NAME: tm-wm-syb
 * @DESCRIPTION:
 * @USER: DELL
 * @DATE: 2023/4/10 8:18
 */
@Service
public class StaffServiceimpl extends ServiceImpl<StaffMapper, StaffEntity> implements StaffService {
    @Resource
    private StaffMapper staffMapper;
    @Override
    public Page<StaffEntity> abc(StaffQueryDTO staffQueryDto) {
        QueryWrapper<StaffEntity> wrapper = new QueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(staffQueryDto.getName()),"name",staffQueryDto.getName());
        Page<StaffEntity> page = new Page<>(staffQueryDto.getPage(),staffQueryDto.getPageSize());
        Page<StaffEntity> page1 = staffMapper.selectPage(page, wrapper);
        return page1;
    }
}
